﻿// create-fbx-anim.cpp : 此文件包含 "main" 函数。程序执行将在此处开始并结束。
//

#include "../Common/Common.h"

#include <cassert>

// Function prototypes.
bool CreateScene(FbxManager* pSdkManager, FbxScene* pScene);

void CreateCube(FbxScene* pScene);
bool CreatePatch(FbxManager* pSdkManager, FbxScene* pScene);

int main()
{
    FBXSDK_printf("Start...\n");

    FbxManager* lSdkManager = NULL;
    FbxScene* lScene = NULL;

    // Prepare the FBX SDK.
    InitializeSdkObjects(lSdkManager, lScene);

    // Create the scene.
    bool lResult = CreateScene(lSdkManager, lScene);
    if (lResult == false)
    {
        FBXSDK_printf("\n\nAn error occurred while creating the scene...\n");
        DestroySdkObjects(lSdkManager, lResult);
        return -1;
    }

    bool ok0 = SaveScene(lSdkManager, lScene, "out_bin.fbx", 0);
    assert(ok0);
    bool ok1 = SaveScene(lSdkManager, lScene, "out_txt.fbx", 1);
    assert(ok1);

    // Destroy all objects created by the FBX SDK.
    DestroySdkObjects(lSdkManager, true);
    return 0;
}

bool CreateScene(FbxManager* pSdkManager, FbxScene* pScene)
{
    CreateCube(pScene);
    CreatePatch(pSdkManager, pScene);
    return true;
}
